#ifndef CLOCKSTATSLOTMODEL_H
#define CLOCKSTATSLOTMODEL_H
// Qt lib import
#include <QObject>
#include <QAbstractListModel>
#include <QDebug>
#include <QString>
#include <QNetworkReply>



class ClockStatSlotModel: public QAbstractListModel
{
    Q_OBJECT

public:
    struct Contact {
        QString date;
        QString time;
        QString place;
        bool isClockOn;
    };
    enum ContactRole {
        DateRole = Qt::DisplayRole,
        TimeRole = Qt::UserRole,
        PlaceRole,
        IsClockOnRole
    };
    Q_ENUM(ContactRole)

    ClockStatSlotModel(QObject *parent = nullptr);

    int rowCount(const QModelIndex & = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    QHash<int, QByteArray> roleNames() const;

    Q_INVOKABLE QVariantMap get(int row) const;
    Q_INVOKABLE void append(const Contact contact);
    Q_INVOKABLE void remove(int row);

private:



    QList<Contact> m_contacts;
};
#endif // CLOCKSTATSLOTMODEL_H
